package com.dayuanit.users ;                           //打包名称：域名倒置.包名
import com.dayuanit.tools.Bike;                       //导入类：当前类中所引用的其他类，都需要进行导入。
import com.dayuanit.school.School;
import com.dayuanit.tools.Computer;
import com.dayuanit.test.Test;


public class Person {
	private String name ;
	private String sex ;
	private int age ;
	private String adds ;
	private Bike bike ;
	private School school ;
	private Test test ;
	private Computer computer;

//=============================================
	public void setTest(Test test){
		this.test = test ;
	}


	public Test getTest(){
		return test ;
	}

	public void setComputer(Computer computer){
		this.computer = computer ;
	}


	public Computer getComputer(){
		return computer ;
	}


	public void setSchool(School school){
		this.school = school ;
	}


	public School getSchool(){
		return school ;
	}


	public void setBike(Bike bike) {
		this.bike= bike ;

	}


	public Bike getBike( ){
		return bike ;
	}



	public void setName(String name) {
		this.name = name ;

	}


	public String getName( ){
		return name ;
	}




	public void setAdds(String adds) {
		this.adds = adds ;

	}


	public String getAdds( ){
		return adds ;
	}




	public void setAge (int age ) {
		if (age<0||age>170) {
			return;			
		}
		this.age = age ;
	}


	public int getAge ( ){
		return age ;
	}



	public void setSex (String sex ){
		if (sex == "男" ) {
			this.sex = sex ;
			
		}

		if (sex == "女") {
			this.sex = sex ;
		}

		else{
			return;
		}

	}


	public String getSex ( ){
		return sex ;

	}


//================================================



	public void goToSchool( ){               //此处bike为局部变量，不受开始时全局变量bike的影响
		

		School school = new School ( ) ;		
		bike.setSchool (school) ;
		school.setName ( "浦口外国语学校" ); 
		school.setAdds ("星火路9号" );


		bike.move (this) ;


	}


	public void doTest ( ){	
		
		Test test = new Test ( );
		computer.setTest (test) ;
		test.setChoose ( 10) ;
		test.setJudge ( 2 );
		test.setDrew ( 5) ;

		computer.run( );


	}


}